﻿<Window x:Class="LMDB.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="LMDB library" xmlns:my="clr-namespace:LMDB" Loaded="Window_Loaded" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="791" d:DesignWidth="824" SizeToContent="WidthAndHeight" WindowStyle="None" BorderBrush="{x:Null}" OpacityMask="{x:Null}" AllowsTransparency="False" OverridesDefaultStyle="False" ResizeMode="CanResize" Foreground="{x:Null}" WindowStartupLocation="CenterScreen" MouseLeftButtonDown="DragStart" Icon="/LMDB;component/ikoon/film.png" xmlns:my1="clr-namespace:System;assembly=mscorlib">
    <Window.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF3D3B37" Offset="0"/>
            <GradientStop Color="#75FFFFFF" Offset="1"/>
        </LinearGradientBrush>
    </Window.Background>
    <Window.Resources>

        <Style x:Key="TabItemFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="3,3,3,1" SnapsToDevicePixels="true"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="TabItemStyle1" TargetType="{x:Type TabItem}">
            <Setter Property="Padding" Value="6,1,6,1"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TabItem}">
                        <Grid SnapsToDevicePixels="true">
                            <Border x:Name="Bd" BorderThickness="0,0,0,3" CornerRadius="30" BorderBrush="Transparent" Background="Transparent">
                                <ContentPresenter x:Name="Content" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True"/>
                            </Border>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="BorderBrush" TargetName="Bd" Value="#6752514D"/>
                                <Setter Property="Background" TargetName="Bd" Value="Transparent"/> 
                            </Trigger>
                            <Trigger Property="IsSelected" Value="true">
                                <Setter Property="Background" Value="#1C000000" TargetName="Bd"/>
                                <Setter Property="BorderBrush" Value="#FF52514D" TargetName="Bd" />

                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="false"/>
                                    <Condition Property="IsMouseOver" Value="true"/>
                                </MultiTrigger.Conditions>

                            </MultiTrigger>
                            <Trigger Property="TabStripPlacement" Value="Bottom">
                                <Setter Property="BorderThickness" TargetName="Bd" Value="1,0,1,1"/>
                            </Trigger>
                            <Trigger Property="TabStripPlacement" Value="Left">
                                <Setter Property="BorderThickness" TargetName="Bd" Value="1,1,0,1"/>
                            </Trigger>
                            <Trigger Property="TabStripPlacement" Value="Right">
                                <Setter Property="BorderThickness" TargetName="Bd" Value="0,1,1,1"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true"/>
                                    <Condition Property="TabStripPlacement" Value="Top"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Margin" Value="-2,-2,-2,-1"/>
                                <Setter Property="Margin" TargetName="Content" Value="0,0,0,1"/>
                            </MultiTrigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true"/>
                                    <Condition Property="TabStripPlacement" Value="Bottom"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Margin" Value="-2,-1,-2,-2"/>
                                <Setter Property="Margin" TargetName="Content" Value="0,1,0,0"/>
                            </MultiTrigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true"/>
                                    <Condition Property="TabStripPlacement" Value="Left"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Margin" Value="-2,-2,-1,-2"/>
                                <Setter Property="Margin" TargetName="Content" Value="0,0,1,0"/>
                            </MultiTrigger>

                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <my:AndmebaasDataSet x:Key="andmebaasDataSet" />
        <CollectionViewSource x:Key="klientViewSource" Source="{Binding Path=Klient, Source={StaticResource andmebaasDataSet}}" />
        <CollectionViewSource x:Key="filmidViewSource" Source="{Binding Path=Filmid, Source={StaticResource andmebaasDataSet}}" />



    </Window.Resources>
    
    <Canvas Height="705" Width="751">
        
        <TabControl Height="630" HorizontalAlignment="Center" Name="tabControl1" VerticalAlignment="Center" Width="668" UseLayoutRounding="False" Opacity="5" Padding="10" BorderThickness="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}" IsEnabled="True" Canvas.Left="30" Canvas.Top="64">
            <TabItem Style="{DynamicResource TabItemStyle1}" Name="tabKlient" Width="Auto" Height="Auto" BorderBrush="{x:Null}" Foreground="{x:Null}" IsEnabled="True" OpacityMask="{x:Null}" Background="{x:Null}" >               
                <TabItem.Header>
                    <StackPanel d:DesignWidth="114.333" d:DesignHeight="106.333" Width="127" Height="127" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Image Source="/ikoon/kasutaja.png" Width="113" Height="97" Name="img1" />
                            <Label Content="Klient" HorizontalContentAlignment="Center" HorizontalAlignment="Center" 
                                VerticalContentAlignment="Center" VerticalAlignment="Center" Foreground="#b4c6cd" 
                                Name="lbl1" FontFamily="Candara" FontSize="16" FontWeight="Bold" />
                        </StackPanel>
                </TabItem.Header>
                <TabItem.Content>
                    <Canvas>
                        <!--siia sisestada tabi sisu-->
                        <ListView Margin="8,9,11,125" Name="listView1" ItemsSource="{Binding}" MinWidth="250" MinHeight="100" Grid.ColumnSpan="2" Grid.RowSpan="2" Height="290" Width="634" Background="#FFAFD864">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Header="id" Width="50"  DisplayMemberBinding="{Binding Path=id}"></GridViewColumn>
                                    <GridViewColumn Header="Eesnimi" DisplayMemberBinding="{Binding Path=eesnimi}"></GridViewColumn>
                                    <GridViewColumn Header="Perenimi" DisplayMemberBinding="{Binding Path=perenimi}"></GridViewColumn>
                                    <GridViewColumn Header="E-mail" DisplayMemberBinding="{Binding Path=email}"></GridViewColumn>
                                </GridView>
                            </ListView.View>
                        </ListView>
                        <Button Canvas.Left="18" Canvas.Top="397.47" Content="Lisa Uus" Height="44" Name="lisa_klient" Width="90" Click="lisa_klient_Click" >
                            <Button.Background>
                                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                    <GradientStop Color="#FFF3F3F3"/>
                                    <GradientStop Color="#FFBEC70A" Offset="1"/>
                                </LinearGradientBrush>
                            </Button.Background>
                        </Button>
                        <Button Canvas.Left="134" Canvas.Top="397.47" Content="Muuda" Height="44" Name="button5" Width="90" Click="Muuda_Click">
                            <Button.Background>
                                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                    <GradientStop Color="#FFF3F3F3"/>
                                    <GradientStop Color="#FFBEC70A" Offset="1"/>
                                </LinearGradientBrush>
                            </Button.Background>
                        </Button>
                        <Button Canvas.Left="250" Canvas.Top="397.47" Content="Kustuta" Height="44" Name="button6" Width="90" Click="button_Kustuta">
                            <Button.Background>
                                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                    <GradientStop Color="#FFF3F3F3"/>
                                    <GradientStop Color="#FFBEC70A" Offset="1"/>
                                </LinearGradientBrush>
                            </Button.Background>
                        </Button>
                        <Button Canvas.Left="482" Canvas.Top="397.47" Content="Otsi" Height="44" Name="button8" Width="90" Click="button_Otsi">
                            <Button.Background>
                                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                    <GradientStop Color="#FFF3F3F3"/>
                                    <GradientStop Color="#FFBEC70A" Offset="1"/>
                                </LinearGradientBrush>
                            </Button.Background>
                        </Button>
                        <TextBox Text="{Binding Path=eesnimi}" Background="#FFAFD864" Canvas.Left="76" Canvas.Top="319" Height="23" Name="eesnimi" Width="107" DataContext="{Binding ElementName=listView1,Path=SelectedItem}" MaxLength="100" BorderThickness="1" CaretBrush="{x:Null}" SelectionOpacity="0.4" ToolTip="Sisesta Eesnimi" UseLayoutRounding="False">
                    
                        </TextBox>
                        <TextBox Background="#FFAFD864" Canvas.Left="276" Canvas.Top="319" Height="23" Name="perenimi" Width="100" DataContext="{Binding ElementName=listView1,Path=SelectedItem}" Text="{Binding Path=perenimi}" ToolTip="Sisesta Perekonnanimi" />
                        <TextBox Background="#FFAFD864" Canvas.Left="433" Canvas.Top="319" Height="22" Name="mail" Width="126" DataContext="{Binding ElementName=listView1,Path=SelectedItem}" Text="{Binding Path=email}" ToolTip="Sisesta Emaili aadress" MaxLength="100" />
                        <TextBox Background="#FFAFD864" Canvas.Left="301.573" Canvas.Top="358" Height="19" Name="id" Width="54" DataContext="{Binding ElementName=listView1,Path=SelectedItem}" Text="{Binding Path=id}" Visibility="Hidden" />
                        <Label Canvas.Left="7" Canvas.Top="317" Content="Eesnimi:" Height="25" Name="label1" Width="56" />
                        <Label Canvas.Left="178" Canvas.Top="319" Content="Perekonnanimi:" Height="23" Name="label2" Width="92" />
                        <Label Canvas.Left="384" Canvas.Top="317" Content="e-mail:" Height="25" Name="label11" Width="68" />
                        <Button Canvas.Left="366" Canvas.Top="397.47" Content="Reset" Height="44" Name="button4" Width="90" Click="resetklient_Click">
                            <Button.Background>
                                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                    <GradientStop Color="#FFF3F3F3"/>
                                    <GradientStop Color="#FFBEC70A" Offset="1"/>
                                </LinearGradientBrush>
                            </Button.Background>
                        </Button>
                    </Canvas>
                </TabItem.Content>
            </TabItem>
            <TabItem Style="{DynamicResource TabItemStyle1}" Name="tabFilm" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}" IsEnabled="True" DataContext="{Binding}">
                <TabItem.Header>
                    <StackPanel d:DesignWidth="114.333" d:DesignHeight="106.333" Width="127" Height="127" HorizontalAlignment="Center" VerticalAlignment="Center">
                        <Image Source="/ikoon/film.png" Width="113" Height="97" Name="img2" />
                        <Label Content="Film" HorizontalContentAlignment="Center" HorizontalAlignment="Center" 
                                VerticalContentAlignment="Center" VerticalAlignment="Center" Foreground="#b4c6cd"
                                Name="lbl2" FontFamily="Candara" FontSize="16" FontWeight="Bold">
                        </Label>
                    </StackPanel>
                </TabItem.Header>
                <Canvas>
                    <!--siia sisestada tabi sisu-->
                    <ListView Background="#FFAFD864" Margin="8,9,11,125" Name="listView2" ItemsSource="{Binding}" MinWidth="250" MinHeight="100" Grid.ColumnSpan="2" Grid.RowSpan="2" Height="290" Width="634">
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Header="Filmi id" Width="50"  DisplayMemberBinding="{Binding Path=film_id}"></GridViewColumn>
                                <GridViewColumn Header="Nimi" DisplayMemberBinding="{Binding Path=nimi}"></GridViewColumn>
                                <GridViewColumn Header="Aasta" DisplayMemberBinding="{Binding Path=aasta}"></GridViewColumn>
                                <GridViewColumn Header="Zanr" DisplayMemberBinding="{Binding Path=zanr}"></GridViewColumn>
                            </GridView>
                        </ListView.View>
                    </ListView>
                    <Button Canvas.Left="20" Canvas.Top="414" Content="Lisa Uus film" Height="44" Name="lisa_film" Width="90" Click="lisa_film_click">
                        <Button.Background>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF3F3F3"/>
                                <GradientStop Color="#FFBEC70A" Offset="1"/>
                            </LinearGradientBrush>
                        </Button.Background>
                    </Button>
                    <Button Canvas.Left="133" Canvas.Top="414" Content="Muuda filmi" Height="44" Name="buttonmuuda" Width="90" Click="muuda_film_click">
                        <Button.Background>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF3F3F3"/>
                                <GradientStop Color="#FFBEC70A" Offset="1"/>
                            </LinearGradientBrush>
                        </Button.Background>
                    </Button>
                    <Button Canvas.Left="247" Canvas.Top="414" Content="Kustuta film" Height="44" Name="buttonkustuta" Width="90" Click="kustuta_film_click">
                        <Button.Background>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF3F3F3"/>
                                <GradientStop Color="#FFBEC70A" Offset="1"/>
                            </LinearGradientBrush>
                        </Button.Background>
                    </Button>
                    <Button Canvas.Left="474" Canvas.Top="414" Content="Otsi" Height="44" Name="buttonotsi" Width="90" Click="otsi_filmi_click">
                        <Button.Background>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF3F3F3"/>
                                <GradientStop Color="#FFBEC70A" Offset="1"/>
                            </LinearGradientBrush>
                        </Button.Background>
                    </Button>
                    <TextBox Background="#FFAFD864" Canvas.Left="62" Canvas.Top="321" Height="23" Name="filmi_aasta" Width="107" DataContext="{Binding ElementName=listView2,Path=SelectedItem}" Text="{Binding Path=aasta}" ToolTip="Sisesta filmi avaldamise aasta" MaxLength="4" />
                    <TextBox Background="#FFAFD864" Canvas.Left="237" Canvas.Top="320" Height="23" Name="filmi_nimi" Width="100" DataContext="{Binding ElementName=listView2,Path=SelectedItem}" Text="{Binding Path=nimi}" ToolTip="Sisesta filmi pealkiri" />
                    <Button Canvas.Left="359" Canvas.Top="414" Content="Reset" Height="44" Name="buttonreset" Width="90" Click="resetfilm_Click">
                        <Button.Background>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF3F3F3"/>
                                <GradientStop Color="#FFBEC70A" Offset="1"/>
                            </LinearGradientBrush>
                        </Button.Background>
                    </Button>
                    <TextBox Background="#FFAFD864" Canvas.Left="243" Canvas.Top="358" Height="26" Name="filmi_id" Width="104" DataContext="{Binding ElementName=listView2,Path=SelectedItem}" Text="{Binding Path=film_id}" Visibility="Hidden" />
                    <TextBox Background="#FFAFD864" Canvas.Left="442" Canvas.Top="319" Height="24" Name="filmi_zanr" Width="100" DataContext="{Binding ElementName=listView2,Path=SelectedItem}" Text="{Binding Path=zanr}" ToolTip="Sisesta filmi žanr" />
                    <Label Canvas.Left="190" Canvas.Top="322" Content="Nimi" Height="23" Name="label7" Width="41" />
                    <Label Canvas.Left="12" Canvas.Top="319" Content="Aasta" Height="24" Name="label8" Width="53" />
                    <Label Canvas.Left="395" Canvas.Top="319" Content="Žanr" Height="28" Name="label9" Width="54" />
                </Canvas>

            </TabItem>
            <TabItem Style="{DynamicResource TabItemStyle1}" Name="tabLaenutus" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}">
                <TabItem.Header>
                    <StackPanel d:DesignWidth="114.333" d:DesignHeight="106.333" Width="127" Height="127" HorizontalAlignment="Center" VerticalAlignment="Center">
                        <Image Source="/ikoon/volg.png" Width="113" Height="97" Name="img3"/>
                        <Label Content="Laenutus" HorizontalContentAlignment="Center" HorizontalAlignment="Center" 
                                VerticalContentAlignment="Center" VerticalAlignment="Center" Foreground="#b4c6cd" 
                                Name="lbl3" FontFamily="Candara" FontSize="16" FontWeight="Bold" />
                    </StackPanel>
                </TabItem.Header>
                <Canvas DataContext="{StaticResource klientViewSource}">
                    <!--siia sisestada tabi sisu-->
                    <Label Canvas.Left="19.643" Canvas.Top="369" Content="Laenatav film" Height="27.775" Name="label3" />
                    <Label Canvas.Left="10" Canvas.Top="314" Content="Kliendi eesnimi" Height="27.775" Name="label4" />
                    <DatePicker Background="#FFAFD864" Canvas.Left="384" Canvas.Top="368" Height="25.553" Name="datePicker1" Width="115.544" SelectedDateFormat="Short" Text="Vail" ToolTip="Vali kuupäev millal film hiljemalt tagastatakse" />
                    <Label Canvas.Left="290" Canvas.Top="365" Content="Tagastamis kp" Height="27.775" Name="label5" />
                    <Button Canvas.Left="198" Canvas.Top="413" Content="Laenuta" Height="51" Name="button2" Width="247" Click="Laenuta_Click">
                        <Button.Background>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF3F3F3"/>
                                <GradientStop Color="#FFBEC70A" Offset="1"/>
                            </LinearGradientBrush>
                        </Button.Background>
                    </Button>
                    <TextBox Background="#FFAFD864" Canvas.Left="384" Canvas.Top="313.775" Height="26" Name="klientlaenutus2" Width="143.622" IsReadOnly="True"  DataContext="{Binding ElementName=listView3,Path=SelectedItem}" Text="{Binding Path=perenimi}"/>
                    <Label Canvas.Left="250.426" Canvas.Top="314" Content="Kliendi perekonnanimi" Height="26" Name="label6" Width="127.574" />
                    <TextBox Background="#FFAFD864" Canvas.Left="106.093" Canvas.Top="314" Height="26" Name="klientlaenutus" Width="135.451" IsReadOnly="True"  DataContext="{Binding ElementName=listView3,Path=SelectedItem}" Text="{Binding Path=eesnimi}" />
                    <TextBox Background="#FFAFD864" Canvas.Left="106.093" Canvas.Top="369" Height="27" Name="filmlaenutus" Width="132.137" IsReadOnly="true" DataContext="{Binding ElementName=listView4,Path=SelectedItem}" Text="{Binding Path=nimi}"  />
                    <Grid Canvas.Left="6" Canvas.Top="0" Height="299" Name="grid1" Width="636" HorizontalAlignment="Center">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="318*" />
                            <ColumnDefinition Width="318*" />
                        </Grid.ColumnDefinitions>
                        <ListView Background="#FFAFD864" Name="listView3" ItemsSource="{Binding}" DataContext="{Binding}" HorizontalAlignment="Center" Width="312" HorizontalContentAlignment="Center" SelectionMode="Single" Padding="-2,-2,0,0" Margin="0,0,6,0">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Header="ID" Width="30" DisplayMemberBinding="{Binding Path=id}"></GridViewColumn>
                                    <GridViewColumn Header="Eesnimi" Width="110" DisplayMemberBinding="{Binding Path=eesnimi}"></GridViewColumn>
                                    <GridViewColumn Header="Perekonnanimi" Width="130" DisplayMemberBinding="{Binding Path=perenimi}"></GridViewColumn>

                                </GridView>
                            </ListView.View>
                        </ListView>
                        <ListView Background="#FFAFD864" Name="listView4" ItemsSource="{Binding}" HorizontalAlignment="Center" Width="318" Height="299" VerticalAlignment="Top" Grid.Column="1" HorizontalContentAlignment="Center" SelectionMode="Single" Padding="-1,-1,-2,0" Margin="0,-1,0,0">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Header="ID" Width="30" DisplayMemberBinding="{Binding Path=film_id}"></GridViewColumn>
                                    <GridViewColumn Header="Filmi nimi" Width="250" DisplayMemberBinding="{Binding Path=nimi}"></GridViewColumn>
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </Grid>
                </Canvas>
            </TabItem>
            <TabItem Style="{DynamicResource TabItemStyle1}" Name="tabLaenatud" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}">
                <TabItem.Header>
                    <StackPanel d:DesignWidth="114.333" d:DesignHeight="106.333" Width="127" Height="127" HorizontalAlignment="Center" VerticalAlignment="Center">
                        <Image Source="/ikoon/laenuta.png" Width="113" Height="97" Name="img4"/>
                        <Label Content="Laenutatud" HorizontalContentAlignment="Center" HorizontalAlignment="Center"
                            VerticalContentAlignment="Center" VerticalAlignment="Center" Foreground="#b4c6cd"
                            Name="lbl4" FontFamily="Candara" FontSize="16" FontWeight="Bold" />
                    </StackPanel>
                </TabItem.Header>
                <Canvas>
                    <!--siia sisestada tabi sisu-->
                    <ListView Background="#FFAFD864" Name="listView5" ItemsSource="{Binding}" MinWidth="200" MinHeight="100" Margin="200,0,0,0" Height="350" Canvas.Left="-197" Width="645">
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Header="id" Width="25" DisplayMemberBinding="{Binding Path=laenutus_id}"></GridViewColumn>
                                <GridViewColumn Header="Filmi nimi" Width="200" DisplayMemberBinding="{Binding Path=nimi}"></GridViewColumn>
                                <GridViewColumn Header="Kliendi eesnimi" Width="100" DisplayMemberBinding="{Binding Path=eesnimi}"></GridViewColumn>
                                <GridViewColumn Header="Kliendi perenimi" Width="150" DisplayMemberBinding="{Binding Path=perenimi}"></GridViewColumn>
                                <GridViewColumn Header="Tagastus kuupäev" Width="100" DisplayMemberBinding="{Binding Path=tkp, StringFormat={}{0:MM/dd/yyyy}}"></GridViewColumn>
                            </GridView>
                        </ListView.View>
                    </ListView>
                    <Button Canvas.Left="198" Canvas.Top="392" Content="Tagasta" Height="56" Name="tagasta_click" Width="220" Click="tagasta_click_Click">
                        <Button.Background>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF3F3F3"/>
                                <GradientStop Color="#FFBEC70A" Offset="1"/>
                            </LinearGradientBrush>
                        </Button.Background>
                    </Button>
                </Canvas>
            </TabItem>
            <TabItem Style="{DynamicResource TabItemStyle1}" Name="tabStat" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}">
                <TabItem.Header>
                <StackPanel d:DesignWidth="114.333" d:DesignHeight="106.333" Width="127" Height="127" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Image Source="/ikoon/folder.png" Width="113" Height="97" Name="img5"/>
                    <Label Content="Statistika" HorizontalContentAlignment="Center" HorizontalAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Center" Foreground="#b4c6cd"
                                       Name="lbl5" FontFamily="Candara" FontSize="16" FontWeight="Bold"/>
                </StackPanel>
                </TabItem.Header>
                <Canvas>
                    <ListView Background="#FFAFD864" Name="listView6" ItemsSource="{Binding}" MinWidth="200" MinHeight="100" Margin="200,0,0,0" Height="314" Canvas.Left="-200" Width="249" Canvas.Top="0">
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Header="Filmi nimi" Width="130" DisplayMemberBinding="{Binding Path=nimi}"></GridViewColumn>
                                <GridViewColumn Header="Palju laenutatud" Width="100" DisplayMemberBinding="{Binding Path=Kokku}"></GridViewColumn>
                            </GridView>
                        </ListView.View>
                    </ListView>
                    <ListView Background="#FFAFD864" Canvas.Left="255" Canvas.Top="0" Height="314" ItemsSource="{Binding}" MinHeight="100" MinWidth="200" Name="listView7" Width="393">
                        <ListView.View>
                            <GridView>
                                <GridViewColumn DisplayMemberBinding="{Binding Path=nimi}" Header="Filmi nimi" Width="130" />
                                <GridViewColumn DisplayMemberBinding="{Binding Path=tkp, StringFormat={}{0:MM/dd/yyyy}}" Header="Tagastuse kp" Width="100" />
                                <GridViewColumn DisplayMemberBinding="{Binding Path=email}" Header="E-mail" Width="150" />
                            </GridView>
                        </ListView.View>
                    </ListView>
                    <Button Canvas.Left="392" Canvas.Top="379" Content="Saada e-mail" Height="56" Name="saada_email" Width="220" Click="saada_email_click">
                        <Button.Background>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF3F3F3" />
                                <GradientStop Color="#FFBEC70A" Offset="1" />
                            </LinearGradientBrush>
                        </Button.Background>
                    </Button>
                    <TextBox Canvas.Left="26" Canvas.Top="347" Height="121" Name="email_content" Width="328" Background="#FFAFD864" Text="Kirja sisu" TextWrapping="Wrap" AcceptsReturn="True" />
                    <!--siia sisestada tabi sisu-->
                </Canvas>
            </TabItem>
        </TabControl>
        
        
       
            <Button Canvas.Left="729" Canvas.Top="12" Content="X" Height="22" Name="btn_closeWin" Width="22" Background="#DFE7311B" FontFamily="Candara" FontSize="12" FontWeight="Bold" BorderThickness="8" BorderBrush="#FF327F32" Click="btn_closeWin_Click" />
            <Button Background="#FFEEE331" BorderBrush="#FF327F32" BorderThickness="8" Canvas.Left="701" Canvas.Top="12" Content="__" FontFamily="Candara" FontSize="12" FontWeight="Bold" Height="22" Name="btn_minWin" Width="22" Click="btn_minWin_Click"  />
        <Label Canvas.Left="30" Canvas.Top="6" Content="LMDB library" Height="52" Name="label14" Width="224" FontWeight="Normal" FontFamily="MS UI Gothic" FontSize="36" FontStyle="Normal" Foreground="#FFEE7E00" Padding="2" />
    </Canvas>
</Window>
